package com.hanfeng.client.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;

/**
 * Music实体类
 * @author hanfeng
 * @data 2012-8-30 上午10:04:35
 */
public class Music implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	//歌曲ID
	private int id;
	//歌曲名称
	private String title;
	//歌曲的歌手名
	private String singer;
	//歌曲的专辑名
	private String albumName;
	//歌曲路径
	private String url;
	//歌曲大小
	private long size;	
	//音乐时长
	private long time;	
	//歌曲文件名
	private String musicName;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getSinger() {
		return singer;
	}
	public void setSinger(String singer) {
		this.singer = singer;
	}
	public String getAlbumName() {
		return albumName;
	}
	public void setAlbumName(String albumName) {
		this.albumName = albumName;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public long getSize() {
		return size;
	}
	public void setSize(long size) {
		this.size = size;
	}
	public long getTime() {
		return time;
	}
	public void setTime(long time) {
		this.time = time;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	public String getMusicName() {
		return musicName;
	}
	public void setMusicName(String musicName) {
		this.musicName = musicName;
	}
	/*无参构造方法*/
	public Music(){
		super();
	}
	public Music(String title,String singer,String albumNmae,String url){
		super();
		setTitle(title);
		setSinger(singer);
		setAlbumName(albumName);
		setUrl(url);
	}
	
	/*解决中文乱码问题*/
	private String setChar(String string){
		String result = null;
		try {
			result = new String(string.getBytes("ISO-8859-1"),"GBK");
			if (result.contains("?")) {
				result = string;
			}
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return result;		
	}
	
	
}
